<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>EShopManager</title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">


    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/static/lib/bootstrap/css/bootstrap.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/stylesheets/theme.css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/lib/font-awesome/css/font-awesome.css"/>
    <script src="${pageContext.request.contextPath}/static/lib/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="${pageContext.request.contextPath}/static/lib/bootstrap/js/bootstrap.js"></script>
    <script src="${pageContext.request.contextPath}/static/StorageUtil.js"></script>
    <!-- Demo page code -->

    <style type="text/css">
        #line-chart {
            height: 300px;
            width: 800px;
            margin: 0px auto;
            margin-top: 1em;
        }

        .brand {
            font-family: georgia, serif;
        }

        .brand .first {
            color: #ccc;
            font-style: italic;
        }

        .brand .second {
            color: #fff;
            font-weight: bold;
        }
    </style>
</head>

<body>

<div class="row-fluid">
    <div class="dialog">
        <div class="block">
            <p class="block-heading">管理员登录</p>
            <div class="block-body">
                <form id="myForm" action="${pageContext.request.contextPath}/LoginAndOutController" method="post">
                    <label>Username</label>
                    <input type="text" class="span12" name="username"/>

                    <label>Password</label>
                    <input type="password" class="span12" name="password"/>

                    <label>验证码</label>
                    <input type="text" class="span12" name="code"/>
                    <label>
                        <a href="javascript:changeCode()">
                            <img id="span6" src="${pageContext.request.contextPath}/LoginAndOutController/picCode"/>
                        </a>
                    </label>

                    <div class="span12">
                        <a href="javascript:loginClick()" class="btn btn-primary pull-right">Sign In</a>
                        <label class="remember-me"><input type="checkbox" name="remeberMe" value="1"> Remember me</label>
                    </div>

                    <div class="clearfix"></div>

                </form>
            </div>
        </div>
    </div>
</div>

<script>

    function changeCode() {
        //获取时间戳
        //new Date().getTime()

        $("#span6").prop("src", "${pageContext.request.contextPath}/LoginAndOutController/picCode?time=" + new Date().getTime());
    }

    function loginClick() {
        $("#myForm").submit();

        <%--if ($("#remeberMe").prop("checked")){--%>
        <%--    setCookie("adminUserId",${adminUser.adminUserId},7);--%>
        <%--}--%>
    }
</script>

</body>
</html>
